# -*-coding:utf-8-*-

import unittest
from tests.test_transfers import TestTransfers
from tests.test_roles import TestRoles
from tests.test_roles_nds import TestRolesNds
from tests.test_users import TestUsers, TestUsersRegisterLogin
from tests.test_devices import TestDevices
from tests.test_devices_statistics import TestDevicesStatistics
from tests.test_platform_users import TestPlatformUsers
from tests.test_platform_devices import TestPlatformDevices
from tests.test_platform_areas import TestPlatformAreas
from tests.test_platform_products import TestPlatformProducts
from tests.test_platform_orders import TestPlatformOrders
from tests.test_platform_orders_nds import TestPlatformOrdersNds
from tests.test_platform_vendors import TestPlatformVendors
from tests.test_concurrent import TestConcurrent


# from tests.create_new_vendor import TestPlatformOrdersNds

def main():
    cases = [
        # OK
        # unittest.TestLoader().loadTestsFromTestCase(TestRoles),
        # unittest.TestLoader().loadTestsFromTestCase(TestRolesNds),
        # unittest.TestLoader().loadTestsFromTestCase(TestDevices),
        # unittest.TestLoader().loadTestsFromTestCase(TestPlatformProducts),
        # unittest.TestLoader().loadTestsFromTestCase(TestPlatformOrders),
        unittest.TestLoader().loadTestsFromTestCase(TestPlatformOrdersNds),
        # unittest.TestLoader().loadTestsFromTestCase(TestUsersRegisterLogin),
        # unittest.TestLoader().loadTestsFromTestCase(TestUsers),
        # unittest.TestLoader().loadTestsFromTestCase(TestPlatformDevices),
        # unittest.TestLoader().loadTestsFromTestCase(TestPlatformAreas),
        # unittest.TestLoader().loadTestsFromTestCase(TestPlatformVendors),

        # Fail
        # unittest.TestLoader().loadTestsFromTestCase(TestDevicesStatistics),
        #

        # unittest.TestLoader().loadTestsFromTestCase(TestConcurrent),
    ]
    suite = unittest.TestSuite(cases)
    unittest.TextTestRunner(verbosity=2).run(suite)
    # unittest.main()


def run_spec_case(test):
    suite = unittest.TestSuite()
    suite.addTest(test)
    unittest.TextTestRunner(verbosity=2).run(suite)


if __name__ == '__main__':
    # main()
    # run_spec_case(TestPlatformOrdersNds('test_login_guest'))
    # run_spec_case(TestPlatformOrdersNds('test_bind_consumers'))
    # run_spec_case(TestPlatformOrdersNds('test_app'))
    run_spec_case(TestPlatformOrdersNds('test_qrcode_pay_business'))
    # run_spec_case(TestPlatformOrdersNds('test_agent_bind_wx'))
    # run_spec_case(TestPlatformOrdersNds('test_agent_create_order'))
    # run_spec_case(TestPlatformOrdersNds('test_transfer_common'))
    # run_spec_case(TestPlatformOrdersNds('test_user_reset_password'))
